import type { FormItemRule, FormRules } from 'element-plus'

const userName: FormItemRule[] = [
  { trigger: 'change', required: true, message: '用户名不能为空' },
  { trigger: 'change', min: 2, max: 20, message: '用户名应在2-20个字符' }
]
const password: FormItemRule[] = [
  { trigger: 'change', required: true, message: '密码不能为空' },
  { trigger: 'change', min: 5, max: 20, message: '密码应在5-20个字符' }
]

const nickName: FormItemRule[] = [{ trigger: 'change', required: true, message: '真实姓名不能为空' }]

const loginFormRules: FormRules = {
  userName,
  password
}
const userFormRules: FormRules = {
  userName,
  password,
  nickName
}
export { loginFormRules, userFormRules }
